#!/bin/sh
cd /root 
buildNO=`cat BUILD_NUMBER` 
export buildNO
echo "The latest build number: ${buildNO}"

LABEL=PR-${buildNO}
export LABEL
echo "Add PR prefix: ${LABEL}"

echo "Updating the devops qa environment to the latest build ${LABEL}"
ssh -o TCPKeepAlive=yes -o ServerAliveInterval=50 -t -t deplprod "bash --login -c '>~/.ssh/known_hosts; cp ~/cloud-deployment-key* ~/Deployment/ws_data/; cd /root/Deployment; updateEnvironment ../DeploymentOutput/PRODUCTION-PR.yml ${LABEL}'"